<?php
class Application_Form_Contactus extends Zend_Form
{// all by ammar
    public function init()
    {   
        $validator = new Zend_Validate_Regex('([A-Za-z0-9]+)');
        $validatorEmail = new Zend_Validate_EmailAddress();
                      
        $email = $this->createElement('text','email');
        $email->setLabel('your E-mail: *')
                ->setRequired(true)
                ->setAttrib('size', '40')
                ->setAllowEmpty(false)
                ->addValidator($validatorEmail);
            
        $subject = $this->createElement('text','subject');
        $subject->setLabel('Subject')
                    ->setRequired(true)
                    ->setAttrib('size', '40')
                    ->addValidator($validator);
                  
        $body = $this->createElement('textarea','body');
        $body->setLabel('Body')
                    ->setRequired(true)
                    ->setValue("write your message here")
                    ->setAttrib('ROWS', '6')
                    ->setAttrib('COLS', '40')
                    ->addValidator($validator);
             
        $send = $this->createElement('submit','send');
        $send->setLabel('send')
                ->setIgnore(true);
        
        $this->addElements(array(
                        $email,            
                        $subject,
                        $body,      
                        $send
                  ));
    }
}
?>
